	
	'
	'  compile with fbc -s console simple.bas
	'
	
	#Include "fbpacker.bi"
	
	
	Dim As FB.Packer package
	
	
	' add file to package
	' this will load "simple.bas" and add it to package using label "source"	
	package.AddFile "source", "simple.bas"

	
	' write package to "simple.pack" and encrypt data using provided password
	If package.Save("simple.pack", "my uber secure password") = 0 Then
		
		Print "Error saving package..."
		Sleep
		End
		
	EndIf

	' remove all items from package
	' normaly you will not use same object to save/load data but this is just an example...
	package.Clear
	
	' load package using password to encrypt data (it must exactly match to password used with Save) 
	If package.Load("simple.pack", "my uber secure password") = 0 Then
		
		Print "Error loading package..."
		Sleep
		End
		
	EndIf
	
	' extract file labeled "source" to "simple_unpacked.bas"
	package.ExtractFile "source", "simple_unpacked.bas"
	
	
	' release memory... package.Clear will be called implicitly when variable goes 
	' out of scope but it's good pratice to release memory when you don't need it anymore
	package.Clear
	
